home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 30 / 030.d81 / sign language (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  143 lines

  1. 10 rem   sign language
  2. 20 ifx=0thenx=1:load"unpacker",8,1
  3. 30 ifx=1thenx=2:load"alpha.lnk",8,1
  4. 35 ifx=2thenx=3:load"hi-res text.o",8,1
  5. 40 poke52,106: rem fretop to protect shps
  6. 42 poke56,64:clr: rem move basic down
  7. 50 clr:dims(25)
  8. 55 forx=0to25:ifx=9then58
  9. 57 s(x)=x:ifx>8thens(x)=x-1
  10. 58 next:sp=200:ss$="medium"
  11. 60 gosub10000:print""tab(9)"[158][211]ign [204]anguage [212]utorial"
  12. 65 printtab(12)"by [193]lan [199]ardner"
  13. 66 printtab(9)"[199]raphics by [202]erry [202]ones"
  14. 70 :
  15. 80 print"[200]ere are your options:"
  16. 82 print" [212][146]ranslate to [211]ign [204]anguage"
  17. 84 print" [209][146]uiz [205]ode"
  18. 86 print" [195][146]hange [212]ranslate [211]peed"
  19. 87 print" [210][146]eturn to [204][207][193][196][211][212][193][210]"
  20. 88 print"[215]hich would you like?";
  21. 90 poke198,0:wait198,1:geta$:ifa$<>"t"anda$<>"q"anda$<>"c"anda$<>"r"then90
  22. 95 :
  23. 97 ifa$="t"then1000
  24. 98 ifa$="q"then2000
  25. 99 ifa$="c"then4000
  26. 100 :
  27. 102 open15,8,15,"r0:setup=setup":input#15,e:close15:ife<>63thenend
  28. 105 load"hello connect",8
  29. 200 :
  30. 1000 rem   translate to sign language
  31. 1010 print"[147]  [204]etters to [211]ign [204]anguage [212]ranslation"
  32. 1020 print"  [207].[203]., [217]ou supply a phrase and [201]'ll"
  33. 1022 print"translate it to sign language before"
  34. 1024 print"your very eyes or just press [210][197][212][213][210][206] to return to [205]ain [205]enu."
  35. 1030 print"[197]nter your phrase. (up to 80 characters)"
  36. 1040 f$="":gosub24800:f$=s$:iff$=""then60
  37. 1050 poke249,224:poke250,204
  38. 1055 poke251,0:poke252,64:poke253,0:poke254,0:poke255,29:sys51462
  39. 1060 poke253,12:poke254,6:sys51459:fordl=1to400:next:s$=""
  40. 1065 :
  41. 1070 forx=1tolen(f$)
  42. 1080 a$=mid$(f$,x,1):a=asc(a$+chr$(0))
  43. 1090 ifa>128thena$=chr$(a-128)
  44. 1100 ifa$<"a"ora$>"z"then1130
  45. 1105 ifa$=s$ors=25thenpoke253,0:poke254,0:poke255,29:sys51462
  46. 1107 sys50759,chr$(asc(a$)+128),152,168:
  47. 1108 poke249,224:poke250,204
  48. 1109 poke251,0:poke252,64:poke253,12:poke254,6
  49. 1110 a=asc(a$)-65:ifa=9thengosub3000:goto1122 :rem "j"
  50. 1112 ifa=25thengosub3500:goto1122 :rem "z"
  51. 1114 poke253,12:poke254,6:poke255,s(a):sys51462
  52. 1122 poke253,12:poke254,6
  53. 1130 fordl=0tosp:nextdl
  54. 1135 s$=a$:s=a:next
  55. 1140 :
  56. 1145 sys50759,"press a key to continue",64,180
  57. 1150 poke198,0:wait198,1:poke198,0:sys51459:goto1000
  58. 2000 rem   quiz mode
  59. 2010 print"[147]"
  60. 2020 print"  [201]n this mode, [201] will show you a"
  61. 2022 print"letter in sign language and ask you to"
  62. 2024 print"tell me what letter you just saw."
  63. 2026 print"[208]retty simple, huh?"
  64. 2028 print"  [207]h, by the way... [201] [215][201][204][204] be keeping"
  65. 2030 print"up with your progress."
  66. 2040 print"   <[208]ress a key when you are ready.>"
  67. 2045 poke198,0:wait198,1:poke198,0:print"[147]";:fordl=1to50:nextdl
  68. 2050 poke249,224:poke250,204:poke251,0:poke252,64
  69. 2060 na=0:nw=0:poke253,0:poke254,0:poke255,29:sys51462:poke253,12:poke254,6
  70. 2070 poke253,0:poke254,0:poke255,29:sys51462:poke253,12:poke254,6
  71. 2072 sys51459:poke253,12:poke254,6:a=int(rnd(1)*26)
  72. 2080 ifa=9thengosub3000:goto2100
  73. 2082 ifa=25thengosub3500:goto2100
  74. 2090 poke255,s(a):sys51462
  75. 2100 fordl=1tosp*2:next:na=na+1
  76. 2110 sys51459:print"[147][215]hich letter was that ? ";
  77. 2112 poke198,0:wait198,1:getf$:printf$
  78. 2120 ifasc(f$+chr$(0))=65+athenprint"[212]hat's correct...":goto2140
  79. 2130 print"[212]hat's wrong... [212]he letter was: ";chr$(a+193):nw=nw+1
  80. 2140 print"       <[208]ress a key to continue>"
  81. 2145 print"          <[208]ress '[209]' to [209]uit>"
  82. 2150 poke198,0:wait198,1:geta$:ifa$="q"then2200
  83. 2160 print"[147]";:fordl=1to50:nextdl:goto2070
  84. 2200 print" [207]ut of"na"letters";:ifna=1thenprint"[157]";
  85. 2210 print" tested, you got"
  86. 2220 printna-nw"correct."
  87. 2230 :
  88. 2240 av=(na-nw)/na:print
  89. 2250 ifav>.9thenprint"[212]hat's very good.":goto2300
  90. 2255 ifav>.8thenprint"[212]hat's not too shabby.":goto2300
  91. 2260 ifav>.7thenprint"[215]ell, you're getting there.":goto2300
  92. 2265 ifav>.6thenprint"[212]hat's really not that good.":goto2300
  93. 2270 print"[212]oday's not your day, is it?"
  94. 2300 print"    <[208]ress a key to go to the menu.>"
  95. 2310 poke198,0:wait198,1:poke198,0:goto60
  96. 2999 end
  97. 3000 rem   display "j"
  98. 3005 poke253,12:poke254,6
  99. 3010 poke255,25:sys51462
  100. 3012 poke255,26:sys51462
  101. 3014 poke255,27:sys51462
  102. 3016 poke255,28:sys51462
  103. 3018 return
  104. 3500 rem   display "z"
  105. 3510 poke253,12:poke254,6
  106. 3515 poke255,s(a):sys51462
  107. 3517 for mo=12 to 15:poke253,mo:sys51462::next
  108. 3520 h=6
  109. 3530 for mo=15 to 12 step-1:poke253,mo:poke254,h:sys51462:h=h+1:next
  110. 3540 for mo=12 to 15:poke253,mo:sys51462:next
  111. 3550 return
  112. 4000 rem  change translate speed
  113. 4010 print"[147]       [208]resent speed is "ss$"."
  114. 4015 print"   [207]ptions are [211]low, [205]edium, or [198]ast"
  115. 4020 print"     [211]elect new speed: [211], [205], or [198]"
  116. 4022 poke198,0:wait198,1:getsp$:ifsp$<>"s"andsp$<>"m"andsp$<>"f"then4022
  117. 4030 ifsp$="s"thenss$="slow":sp=500
  118. 4032 ifsp$="m"thenss$="medium":sp=200
  119. 4034 ifsp$="f"thenss$="fast":sp=50
  120. 4050 goto60
  121. 9998 rem *** border ***
  122. 10000 poke53281,0:poke53280,6
  123. 10005 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
  124. 10010 fort=1to23:print"[221][157][157][221]";:next
  125. 10020 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":poke2023,125
  126. 10030 poke2023+54272,1:return
  127. 24800 l$="a":h$="z":l=79:gosub25000:return
  128. 24900 l$="a":h$="z":l=79:gosub25000:return
  129. 24998 rem *** input string ***
  130. 25000 ls=0:s$=""
  131. 25005 print" [157]>[157]";
  132. 25010 getr$:ifr$<>""then25040
  133. 25020 print" [157]<[157]";
  134. 25030 getr$:ifr$=""then25005
  135. 25040 ifr$=chr$(20)then25200
  136. 25045 ifr$=chr$(13)then return
  137. 25050 if(r$<l$orr$>h$)andr$<>" "then25005
  138. 25055 ls=ls+1:ifls>lthenls=l:goto25005
  139. 25060 s$=s$+r$:printr$;:goto25005
  140. 25200 ls=ls-1:ifls<0thenls=0:goto25220
  141. 25210 print"[157]  [157][157]";
  142. 25220 s$=left$(s$,ls):goto25005
  143.